/*
 * This file is part of QuickCPP.
 * (c) Copyright 2011 Jie Wang(twj31470952@gmail.com)
 *
 * QuickCPP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * QuickCPP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with QuickCPP.  If not, see <http://www.gnu.org/licenses/>.
 */
 
//==============================================================================
//
// $Revision: 2 $
// $Date: 2011-02-22 06:59:58 +0000 (Tue, 22 Feb 2011) $
//
//==============================================================================

#ifndef QC_XML_InternalEntity_h
#define QC_XML_InternalEntity_h

#ifndef QC_XML_defs_h
#include "defs.h"
#endif //QC_XML_defs_h

#ifndef QC_XML_Entity_h
#include "Entity.h"
#endif //QC_XML_Entity_h

QC_XML_NAMESPACE_BEGIN

class BufferRange;

class QC_XML_PKG InternalEntity : public Entity
{
public:

	InternalEntity(EntityType type, const Entity* pParent, bool bExternallyDeclared, 
	               const String& name, Reader* pReader,
	               const StreamPosition& location,
	               bool bSimpleData);

	~InternalEntity();

	virtual ScannerPosition getStartPosition();
	virtual bool isParsed() const;
	virtual bool isExternalEntity() const;
	virtual bool isInternalEntity() const;
	virtual void load();
	virtual AutoPtr<Reader> getReader() const;

	bool isSimpleData() const;
	BufferRange getBufferRange() const;

private:
	AutoPtr<Reader> m_rpReader;
	ScannerPosition m_startPosition;
	bool m_bSimpleData;
};

QC_XML_NAMESPACE_END

#endif //QC_XML_InternalEntity_h
